package jude.java.money.beans;

import org.apache.commons.lang.StringUtils;

import jude.java.money.beans.global.BaseBean;

public class WebSite extends BaseBean {

	private static final long serialVersionUID = 3960761332864512664L;

	private String group;
	private String name;
	private String url;
	private String title;
	
	public WebSite() {
	}
	
	public WebSite(String name, String url) {
		this.name = name;
		this.url = url;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public void setGroup(String group) {
		this.group = group;
	}
	public String getGroup() {
		return group;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	
	/////////////////////////////////////////
	
	public String getHttpUrl() {
		if (StringUtils.isEmpty(url))
			return "#";
		if (url.startsWith("http:"))
			return url;
		return "http://" + url;
	}
	
	@Override
	public String toString() {
		return name + " = " + url;
	}
}
